<template>
  <div class="rated-item">
    <div class="img">
      <img :src="item.imgUrl" alt="" />
      <div class="shadow" v-if="item.score">观众评分: {{ item.score }}</div>
      <div class="shadow" v-else>{{ item.wishNum }} 人想看</div>
    </div>

    <p>{{ item.title }}</p>
  </div>
</template>

<script>
export default {
  props: ["item"],
};
</script>

<style lang="less" scoped>
@import "../../../../../assets/css/var.less";
.rated-item {
  width: 85px;
  height: 100%;
  margin-right: 10px;
  flex-shrink: 0;
  font-size: 14px;

  &:last-child {
    margin-right: 0;
  }

  .img {
    width: 85px;
    height: 115px;
    position: relative;

    img {
      width: 100%;
      height: 100%;
    }

    .shadow {
      position: absolute;
      width: 100%;
      height: 20px;
      background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.2),
        rgba(0, 0, 0, 0.7)
      );
      bottom: 0;
      left: 0;
      color: yellow;
      font-size: @xs-font;
      line-height: 20px;
    }
  }

  p {
    font-weight: 900;
    margin-top: 4px;
    width: 100%;
    .ell();
  }
}
</style>
